﻿// Decompiled with JetBrains decompiler
// Type: Netick.CodeGen.ILPostProcessCompiledAssembly
// Assembly: Netick.CodeGen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 95965C71-875F-44B8-BA79-93A19C7D6A17
// Assembly location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Editor\Netick.CodeGen.dll

using System.IO;

#nullable disable
namespace Netick.CodeGen;

internal class ILPostProcessCompiledAssembly
{
  private readonly string m_AssemblyFilename;
  private readonly string m_OutputPath;
  private InMemoryAssembly m_InMemoryAssembly;

  public ILPostProcessCompiledAssembly(
    string asmName,
    string[] refs,
    string[] defines,
    string outputPath)
  {
    this.m_AssemblyFilename = asmName;
    this.Name = Path.GetFileNameWithoutExtension(this.m_AssemblyFilename);
    this.References = refs;
    this.Defines = defines;
    this.m_OutputPath = outputPath;
  }

  public string Name { get; }

  public string[] References { get; }

  public string[] Defines { get; }

  public InMemoryAssembly InMemoryAssembly
  {
    get
    {
      if (this.m_InMemoryAssembly == null)
        this.m_InMemoryAssembly = new InMemoryAssembly(File.ReadAllBytes(Path.Combine(this.m_OutputPath, this.m_AssemblyFilename)), File.ReadAllBytes(Path.Combine(this.m_OutputPath, Path.GetFileNameWithoutExtension(this.m_AssemblyFilename) + ".pdb")));
      return this.m_InMemoryAssembly;
    }
  }
}
